#include "Menu.h"
#include <iostream>
using namespace std;
namespace GASPUMP
{

Menu::Menu(void)
{
}

void Menu::UserMenu(  )
{
	dispenser dsp;

	ReceiptPrinter rp;

	m_menurun = true;
	
	bool terminate = false;
	
		while(m_menurun = true)	
		{
		std::cout << "Welcome, please enter an option to operate dispenser:" << std::endl;
		std::cout << "Enter 1 to normal operation." << std::endl;
		std::cout << "Enter 2 enter maintenance mode." << std::endl;
		cout << "Enter 3 to enter re-supply mode." << endl;
		cout << "Enter 0 to place the dispenser in a shutdown state." << endl;

		std::cin >> m_menuswitch;

		switch(m_menuswitch)
		{
		case 0: cout << "Now entering shutdown mode." << dsp.operOFF() << endl; break ;
		case 1: cout << "Now entering normal operation." << dsp.operON() << endl;
			dsp.execute();
			terminate = false;
			cout << "\n";
			cout << "Please take your receipt " << endl;
			cout << "\n";
			cout << "Thanks for choosing Argo Gas Station! " << endl;
			cout << "\n";
			_sleep( 5000 );
			break;
		case 2: cout << "Now entering maintenance mode." << dsp.operMAINT() << endl; break;
		case 3: cout << "Now entering Re-supply mode." << dsp.operRESUP() << endl; break;
		}
	}while( terminate );
}

Menu::~Menu(void)
{
}

}